<!--子页面-->
<?php
use yii\widgets\LinkPager;
?>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>操作日志列表</h5>
                </div>
                <div class="ibox-content">
                    <div class="form-group form-horizontal form-style">
                        <form class="" action="">
                            <div class="row m-b">
                                <label class="col-sm-1 control-label">时间</label>
                                <div class="col-xs-3">
                                    <input type="text" name="input_date" value="<?=$input_date?>" class="form-control" placeholder="选择时间范围">
                                </div>
                                <label class="col-sm-1 control-label">管理员ID</label>
                                <div class="col-sm-2">
                                    <input type="text" name="admin_id" class="form-control" value="<?=$admin_id?>">
                                </div>
                                <label class="col-sm-1 control-label">关键词</label>
                                <div class="col-sm-2">
                                    <input type="text" name="keyword" class="form-control" value="<?=$keyword?>">
                                </div>
                                <div class="col-sm-2">
                                    <button type="submit" class="btn  btn-primary">搜索</button>
                                </div>
                            </div>
                        </form>
                    </div>

                    <?php if(!empty($list)){?>
                        <table class="table table-striped table-bordered table-hover dataTables-example">
                            <thead>
                            <tr class="tb-title">
                                <th class="text-center">ID</th>
                                <th class="text-center">用户名/ID</th>
                                <th class="text-center">姓名</th>
                                <th class="text-center">详情</th>
                                <th class="text-center">操作时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php foreach ($list as $k => $v){?>
                                <tr align="center" data-id="<?=$v->id?>">
                                    <td><?=$v->id?></td>
                                    <td><?=isset($v->admin->username)?$v->admin->username:''?><br/><?=$v->admin_id?></td>
                                    <td><?=isset($v->admin->name)?$v->admin->name:''?></td>
                                    <td><?=$v->desc?></td>
                                    <td><?=date('Y-m-d H:i:s',$v['create_time'])?></td>
                                </tr>
                            <?php }?>
                            </tbody>
                        </table>
                    <?php }else{?>
                        <div align="center" style="color: red">
                            暂无数据
                        </div>
                    <?php }?>
                    <div class="row">
                        <div class="col-sm-12  form-inline text-right">
                            <div class="btn-group" align="center">
                                <?= LinkPager::widget(['pagination' => $pagination, 'options'=>['class'=>'page-num'],'firstPageLabel' =>'首页','lastPageLabel'=>'尾页']); ?>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/plugins/layer/laydate5.0.7/laydate.js" type="text/javascript"></script>
    <script>
        $(function(){
            laydate.render({
                elem: 'input[name="input_date"]'
                ,range: '~'
                ,type: 'datetime'
                ,max: "<?=date('Y-m-d',time()-86400)?>"
                ,btns: ['confirm']
            });
        });
    </script>
